-- @owner: @kyeleze
-- @date: 2024/2/3
-- @testpoint: 含有out类型参数的函数，在另一个函数中调用 

--step01:创建一个带out类型参数的函数,调用该函数 expect:成功
drop function if exists t_ddl_create_fun_0156;
create or replace function t_ddl_create_fun_0156(i int, out result_1 bigint, out result_2 bigint)
returns setof record
as $$
begin
    result_1 = i + 1;
    result_2 = i * 10;
return next;
end;
$$language plpgsql;
/
select t_ddl_create_fun_0156(1);

--step02:创建一个函数调用步骤1中的函数,调用该函数 expect:成功
drop function if exists t_ddl_create_fun_0156_01;
create or replace function t_ddl_create_fun_0156_01(i int)
returns void 
as $$
begin
   perform t_ddl_create_fun_0156(i);
end;
$$language plpgsql;
/
select t_ddl_create_fun_0156_01(1);

--step03:清理环境 expect:成功
drop function t_ddl_create_fun_0156;
drop function t_ddl_create_fun_0156_01;
